/* -----------------------------------------------------------------------
 * Chris Lewis
 * CS 362
 * Assignment 3: cardtest1.c to test village card
 *
 * cardtest2: cardtest2.c dominion.o rngs.o
 *      gcc -o cardtest2 -g  cardtest2.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define DEBUG 0
#define NOISY_TEST 1

int main () {
  
  int r;
  int numPlayer = 2;
  int k[10] = {adventurer, council_room, feast, gardens, mine,
               remodel, smithy, village, baron, great_hall};
  int bonus=0;
  struct gameState G;
  int startingHandCount;
  int s;
  
  r = initializeGame(numPlayer, k, 1, &G);

  startingHandCount = G.handCount[0]; 
  int actions = G.numActions;

  puts("\n\n********* TESTING VILLAGE ************\n");

#if (NOISY_TEST == 1)
  printf ("initializeGame(%d, k, 1, &G) = %d\n", numPlayer, r);
#endif
  assert(r == 0);

#if (NOISY_TEST == 1)
  printf("Beginning # of actions: %d\n", G.numActions );
#endif

  puts("playing village");
  s = cardEffect(village,0,0,0,&G,1,&bonus);
  assert(s == 0);

  assert(G.numActions == actions + 1 ); //player spent one action, received two, for a net gain of 1
  assert(G.handCount[0] == startingHandCount);

#if (NOISY_TEST == 1)
  printf("Ending # of actions: %d\n", G.numActions );
#endif


  

  printf("village card: PASS\n");



  
  return 0;
}